<script setup lang="ts">
// import { ref } from "vue";
import wind_speed from '@/assets/bit-screen/schedule-mge/wind-speed-high.png'
import jiangyuliang from '@/assets/bit-screen/schedule-mge/jiangyuliang_mian.png'
import temperature from '@/assets/bit-screen/schedule-mge/temperature.png'
import IOTtubiao_huabanfuben from '@/assets/bit-screen/schedule-mge/IOTtubiao_huabanfuben.png'
import xudianchi from '@/assets/bit-screen/schedule-mge/xudianchi.png'
const weatherList = [
  {
    name: '风速',
    img: wind_speed,
    value: '30',
    unit: 'm/s'
  },
  {
    name: '降雨',
    img: jiangyuliang,
    value: '是',
    unit: ''
  },
  {
    name: '舱内温度',
    img: temperature,
    value: '30',
    unit: '℃'
  },
  {
    name: '舱内湿度',
    img: IOTtubiao_huabanfuben,
    value: '30',
    unit: '%rh'
  },
  {
    name: '电池温度',
    img: xudianchi,
    value: '30',
    unit: '℃'
  }
]
</script>
<template>
  <div class="weatherBox">
    <div class="content-box">
      <div
        :class="{ 'item-box': true, 'more-item-box': index == 10 }"
        v-for="(item, index) in weatherList"
        :key="index"
      >
        <div class="item-top">
          <img class="img" :src="item.img" alt="" />
          <p>{{ item.name }}</p>
        </div>

        <p class="item-bottom"> {{ item.value }}{{ item.unit }} </p>
      </div>
    </div>
  </div>
</template>

<style lang="less" scoped>
.weatherBox {
  margin-bottom: 5px;
  background: rgba(9, 36, 74, 0.9);
  height: 14.5%;
  .content-box {
    display: flex;
    justify-content: space-between;
    height: 100%;
    .item-box {
      width: 18%;
      height: 100%;
      background: #1f406e;
      border: 1px solid #244780;
      border-top: 2px solid #078fd8;
      padding-top: 2.5%;
      display: flex;
      flex-direction: column;
      align-items: center;
      position: relative;
      font-size: 14px;
      .item-top {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: space-between;
        height: 60%;
        img {
          width: 1.5vw;
          height: 3vh;
        }
     
      }

      .item-bottom {
        height: 3vh;
        position: absolute;
        bottom: 0;
        display: flex;
        justify-content: center;
        align-items: center;
        background: rgba(59, 145, 243, 0.5);
        width: 100%;
        height: 25px;
      }
    }

    .more-item-box {
      background: #6a2021;
      opacity: 0.9;
      border: 2px solid #ff4d4f;

      .item-bottom-bg {
        opacity: 0.32;
        background: white;
      }
    }
  }
}
/* 当视口高度大于或等于880px时，应用这些样式 */
@media screen and (min-height: 950px) {
  .weatherBox {
    .item-box {
      padding-top: 3% !important;
      img {
        margin-bottom: 25% !important;
      }
      .item-bottom {
        height: 30px !important;
      }
    }
  }
}
/* 当视口高度大于或等于880px时，应用这些样式 */
@media screen and (max-height: 730px) {
  .item-box {
    padding-top: 1% !important;

    .item-top {
      font-size: 13px !important;
      img {
        width: 20px;
        height: 20px;
        margin-bottom: 0px !important;
      }
    }
  }
}
</style>
